﻿#nullable enable

using System;
using System.Threading.Tasks;

namespace PHMEE.EnergyEfficiency;

public interface ICIIAppService
{
    /// <summary>
    /// 年度CII（未修正）
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="year"></param>
    /// <returns></returns>
    Task<AnnualCIIDto> AnnualCIIUnadjusted(Guid vesselId, int? year);

    /// <summary>
    /// 年度CII（已修正）
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="year"></param>
    /// <returns></returns>
    Task<AnnualCIIDto> AnnualCIIAdjusted(Guid vesselId, int? year);
    
    /// <summary>
    /// 本航次 CII
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<CIIWithGradeDto> CurrentVoyageCII(Guid vesselId);

    /// <summary>
    /// 瞬时 CII
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<CIIWithGradeDto> InstantaneityCII(Guid vesselId);

    /// <summary>
    /// 本年度 CII 预测
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<CIIWithGradeDto> CurrentYearCIIPrediction(Guid vesselId);

    /// <summary>
    /// 本年度累计 CII
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<CIIWithGradeDto> CurrentYearCumulativeCII(Guid vesselId);

    /// <summary>
    /// CII 模拟器
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="targetCIIGrade"></param>
    /// <returns></returns>
    Task<CIIAndVDto> ExpectedPerformanceToMeetCIICurrentYear(Guid vesselId,
        CIIGrade targetCIIGrade);

    /// <summary>
    /// 目标航次预估 CII
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="targetDistance">目标航次的距离</param>
    /// <param name="hours">目标航次航行小时数</param>
    /// <returns></returns>
    Task<CIIAndVDto> EstimatedCIITargetVoyage(Guid vesselId, float targetDistance, float hours);

    /// <summary>
    /// 本年度累计 CO2 排放
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<Co2EmissionsDto> CurrentYearCumulativeCo2EmissionsAsync(Guid vesselId);

    /// <summary>
    /// 当前（年度）累计 CO2 排放量（已修正）
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<Co2EmissionsDto> CurrentYearCumulativeCo2EmissionsAdjustedAsync(Guid vesselId);

    /// <summary>
    /// CII 营运碳强度对比
    /// </summary>
    /// <returns></returns>
    Task<CIIComparisionDto> CIIOperationalCarbonIntensityComparisonAsync(Guid vesselId,
        DateTime startDate, DateTime endDate);

    /// <summary>
    /// CII 营运碳强度对比（范围为年）
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="year"></param>
    /// <returns></returns>
    Task<CIIComparisionDto> CIIOperationalCarbonIntensityComparisonByYearAsync(Guid vesselId, int year);
    
    /// <summary>
    /// 获取 CII 等级边界
    /// </summary>
    /// <param name="vesselId"></param>
    /// <returns></returns>
    Task<CIIGradeBoundariesDto> CIIGradeBoundariesAsync(Guid vesselId);
}